<?php
/**
 * Created by PhpStorm.
 * User: Jiarui
 * Date: 2015/11/18
 * Time: 13:47
 */

namespace Home\Model;
use Think\Model;

class SettingModel extends Model
{
    public function getHomePage(){

        $homePage =  new \stdClass();

        $homePage1 = $this->where(array('key_word'=>'homePage1'))->find();

        $homePage->data['homePage1'] = $homePage1;

        $homePage2 = $this->where(array('key_word'=>'homePage2'))->find();

        $homePage->data['homePage2'] = $homePage2;

        $homePage3 = $this->where(array('key_word'=>'homePage3'))->find();

        $homePage->data['homePage3'] = $homePage3;

        $homePage4 = $this->where(array('key_word'=>'homePage4'))->find();

        $homePage->data['homePage4'] = $homePage4;

        return $homePage->data;

    }

    public function getCodeGZ(){
        $setting = M('setting');

        $data = $setting->where(array('key_word'=>'codeGZ'))->find();

        return $data['value'];
    }
}